package org.JWCB.system.manager;


import org.JWCB.common.core.constants.CacheConstants;
import org.JWCB.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class QuestionCacheManager {


    @Autowired
    private RedisService redisService;

    /**
     * 数据添加到缓存
     */
    public void addCache(long questionId) {
        redisService.leftPushForList(CacheConstants.QUESTION_ID_LIST_KEY,questionId);
    }


    /**
     * 数据从缓存中删除
     */
    public void delCache(long questionId) {
        redisService.removeForList(CacheConstants.QUESTION_ID_LIST_KEY,questionId);
    }
}
